package subject2;

public class Edge
{
    private int startID;
    private int endID;

    public Edge()
    {
        this(0,0);
    }
    public Edge(String  nodeID)
    {
        this();
        String []tmp=nodeID.split(" ");
        if(tmp.length!=2)
            throw new IllegalArgumentException();
        setStartID(Integer.parseInt(tmp[0]));
        setEndID(Integer.parseInt(tmp[1]));
    }

    public Edge(int startID,int endID)
    {
        this.startID=startID;
        this.endID=endID;
    }

    public int getStartID()
    {
        return this.startID;
    }

    public void setStartID(int startID)
    {
        this.startID=startID;
    }

    public int getEndID()
    {
        return this.endID;
    }

    public void setEndID(int endID)
    {
        this.endID=endID;
    }
    public String toString()
    {
        return ""+startID+"--->"+endID;
    }
}
